home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
netprog.zip
/
NETPROG.TAR
/
net.s5
/
streammod.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-12-17
|
670b
|
41 lines
/*
* Determine which stream modules have been pushed onto a stream.
*/
#include <stdio.h>
#include <fcntl.h>
#include <tiuser.h>
#include <stropts.h>
#include <sys/conf.h>
main()
{
doit("/dev/tcp");
doit("/dev/udp");
}
doit(name)
char *name;
{
int tfd;
char filename[FMNAMESZ + 1];
struct t_info info;
printf("stream = %s\n", name);
if ( (tfd = t_open(name, O_RDWR, &info)) < 0)
err_sys("can't open %s", name);
for ( ; ; ) {
if (ioctl(tfd, I_LOOK, filename) < 0) {
err_ret("ioctl I_LOOK error");
break;
}
printf(" module = %s\n", filename);
if (ioctl(tfd, I_POP, (char *) 0) < 0)
err_sys("ioctl I_POP error");
}
fflush(stdout);
}